package com.zzx.day57Demo.Biz.impl;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.zzx.day57Demo.Biz.DecoratentBiz;
import com.zzx.day57Demo.DAO.DecoratentDAO;
import com.zzx.day57Demo.model.Decoratent;
@Service("decoratentBiz")
@Scope("prototype")
public class DecoratentBizImpl implements DecoratentBiz {
	private DecoratentDAO decoratentDAO;
	

	public void setDecoratentDAO(DecoratentDAO decoratentDAO) {
		this.decoratentDAO = decoratentDAO;
	}

	@Override
	public List<Decoratent> findAll() {
		System.out.println("Decoratentbiz.findall");
		return decoratentDAO.findAll();
		
	}

	public void saveOrUpdate(Decoratent dec){
		decoratentDAO.saveOrUpdate(dec);
	}
	
	public Decoratent findById(int decId){
		return decoratentDAO.findById(decId);
	}

	public void delete(int decId){
		decoratentDAO.delete(decoratentDAO.findById(decId));
	}

}
